
from flask import Flask,escape,request

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello,World!<p>"

@app.route("/hello")
def hello():
    return "<p>Hello!<p>"

# methods制定监听类型
@app.route("/param",methods=["post","get"])
def get_param():
    # 获取请求参数
    return request.args,request.json

# <>中间放变量
@app.route("/hello/<a>")
def get_var(a):
    return a

if __name__ == "__main__":
    app.run(debug=True,port=5001) #运行服务